<?php
namespace App\Controllers;
use App\Requests\CaseRequest;
use App\Services\CaseService as Service;
use Framework\BaseController;
use Illuminate\Http\Request;
class CaseController extends BaseController
{
    /**
     * @var Service
     */
    private $service;

    public function __construct(Service $service)
    {
        $this->service = $service;
    }


    public function releaseCase(CaseRequest $request)
    {
        $user_id = $this->getAuthId();
        $content = $request->content();
        $video = $request->video();
        $info = $this->service->releaseCase($user_id,$content,$video);
        $this->retSuccess($info);
    }

    public function getCaseList(Request $request)
    {
        $page = $request->input('page',1);
        $size = $request->input('size',20);
        $info = $this->service->getCaseList($page,$size);
        $this->retSuccess($info);
    }
}
